<template>
    <div class="cate-list-box" :class="isShowCateListBox ? 'cate-list-box-show' : ''">
        <div class="hd">
                <i class="icn"></i>
        </div>
        <div class="bd">
            <h3>
                <router-link :to="cateListBoxData.allStyleRoute" class="u-btn u-btn-g s-fc1">
                    <em>全部风格</em>
                </router-link>
            </h3>
            <dl class="clear-block" v-for="(cateItem, index) in cateListBoxData.cate" key="index">
                <dt>
                    <i class="u-icn" :class="cateItem.cateIcon"></i>
                    {{ cateItem.cateName }}
                </dt>
                <dd :class="{last: index >= cateListBoxData.cate.length - 1}">
                    <template v-for="(item, index2) in cateItem.cateList" key="index2" >
                        <a :data-res-cate="item.route" :href="cateListBoxData.routePrefix + item.route" class="s-fc1">{{ item.name }}</a>
                        <span class="line">|</span>
                    </template>
                </dd>
            </dl>
        </div>
        <div class="ft"></div>
    </div>
</template>
<script setup>
    import cateListBoxData from '@/json_data/cate_list_box_data.json'
    defineProps({
        isShowCateListBox: Boolean
    })
    
</script>
<style lang="scss" scoped>
    .cate-list-box{
        display: none;
        position: absolute;
        top: 75px;
        left: 0;
        z-index: 5;
        width: 720px;
        .hd{
            height: 32px;
            .icn{
                position: absolute;
                top: 2px;
                left: 132px;
                display: inline-block;
                width: 24px;
                height: 11px;
                background-position: -48px 0;
                vertical-align: middle;
            }
        }

        .bd{
            width: 700px;
            padding: 0 10px;
            background-position: -720px 0;
            background-repeat: repeat-y;
        }

        h3{
            height: 37px;
            padding-left: 26px;
            border-bottom: 1px solid #e6e6e6;
            font-weight: normal;
        }

        dt{
            float: left;
            display: inline;
            width: 70px;
            margin: 0 -100px 0 26px;
            padding-top: 15px;
            border-right: 1px solid #e6e6e6;
            font-weight: bold;
        }

        .u-icn{
            margin-right: 8px;
            margin-bottom: 4px;
        }

        dd{
            margin-left: 96px;
            padding: 16px 15px 0 15px;
            border-left: 1px solid #e6e6e6;
            line-height: 24px;

            a{
                white-space: nowrap;
            }

            .line{
                margin: 0 8px 0 10px;
                color: #d8d8d8;
            }

            &.last{
                padding-bottom: 25px;
            }
        }
        .ft{
            height: 20px;
            background-position: -1440px -12px;
        }
    }

    .cate-list-box-show{
        display: block;
    }
</style>